<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
</div>
<script type="text/javascript">

    const student = Vue.extend({
        template: `
          <div>
            <h2>学生姓名：{{ studentName }}</h2>
          </div>
        `,
        data() {
            return {
                studentName: "hpp"
            }
        },
    });

    // school中有student组件
    const school = Vue.extend({
        template: `
          <div>
            <h2>学校名称：{{ schoolNme }}</h2>
            <student></student>
          </div>
        `,
        data() {
            return {
                schoolNme: "非常学院",
            }
        },
        components: {
            student
        }Hello
    });
    const school2 = Vue.extend({
        template: `
          <div>
            <h2>学校名称：{{ schoolNme }}</h2>
          </div>
        `,
        data() {
            return {
                schoolNme: "联盟学院",
            }
        },
        components: {}
    });

    // 用于管理所有的组件
    const app = Vue.extend({
        template: `
          <div>
            <school></school>
            <school2></school2>
          </div>
        `,
        components: {
            school,
            school2
        }
    });

    new Vue({
        el: '#root',
        template: `
          <div>
            <app></app>
          </div>
        `,
        components: {
            app,
        }
    });
</script>

</body>
</html>
